package de.jonasblatt.networkapi.rpi.network.server;

import java.util.LinkedList;
import java.util.List;

public class ServerLog {
	private List<String> messages;
	private Server server;

	public ServerLog(Server server) {
		this.server = server;
		this.messages = new LinkedList<>();
	}

	public void addMessage(String msg) {
		System.out.println(msg);
		this.messages.add(msg);
	}

	public List getMessages() {
		return this.messages;
	}

	public String getMessageString() {
		StringBuilder rtn = new StringBuilder();
		for (String string : this.messages) {
			rtn.append(string);
			rtn.append(System.getProperty("line.separator"));
		}
		return rtn.toString();
	}

}
